<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{$setting['vals']['title']}}</title>
    <meta name="keywords" content="{{$setting['vals']['keywords']}}" />
    <meta name="description" content="{{$setting['vals']['descs']}}" />
    <meta name="_token" content="{{ csrf_token() }}"/>
    <link rel="stylesheet" href="/static/public/layui/css/layui.css">
    <link rel="stylesheet" href="/static/public/swiper/css/swiper.css">
    <link rel="stylesheet" href="/static/home/css/style.css">
    <script type="text/javascript" src="/static/public/layui/layui.js"></script>
    <script type="text/javascript" src="/static/public/swiper/js/swiper.min.js"></script>
</head>
<body>
{{--顶部--}}
@include('home/public/header')
<div class="main" style="margin-top: 10px">
    {{--        banner--}}
    <div class="center">
        <div class="banner-box">
            <div class="banner">
                <div class="swiper-container">
                    <div class="swiper-wrapper">
                        @foreach($banner as $item)
                            <div class="swiper-slide">
                                <a href="">
                                    <img src="{{ $item['thumb'] }}" alt="">
                                </a>
                            </div>
                        @endforeach
                    </div>
                    <!-- Add Pagination -->
                    <div class="swiper-pagination"></div>
                    <!-- Add Arrows -->
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                </div>
            </div>
            <div class="art-top">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        @foreach($cats as $item)
                            <li name="cid" lay-id="{{ $item['id'] }}">{{ $item['title'] }}</li>
                        @endforeach
                        {{--                            <li>用户管理</li>--}}
                        {{--                            <li>权限分配</li>--}}
                        {{--                            <li>商品管理</li>--}}
                        {{--                            <li>订单管理</li>--}}
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show provice">
                            <ul class="provice">
                                @foreach($art as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span> {{$admin[$item['auth_id']]['nickname']}}
                                                    {{--@if($item['auth_id'] != 0)

                                                    {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                    {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif--}}
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}

                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>

                        </div>
                        <div class="layui-tab-item ">
                            <ul class="provice">
                                @foreach($art1 as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span>
{{--                                                    {{$admin[$item['auth_id']]['nickname']}}--}}
                                                    @if($item['auth_id'] == 0)

                                                    {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                    {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                        <div class="layui-tab-item">
                            <ul class="provice">
                                @foreach($art2 as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span>
                                                    @if($item['auth_id'] == 0)

                                                        {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                        {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                        <div class="layui-tab-item">
                            <ul class="provice">
                                @foreach($art3 as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span>
                                                    @if($item['auth_id'] == 0)

                                                        {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                        {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                        <div class="layui-tab-item">
                            <ul class="provice">
                                @foreach($art4 as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span>
                                                    @if($item['auth_id'] == 0)

                                                        {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                        {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                        <div class="layui-tab-item">
                            <ul class="provice">
                                @foreach($art5 as $item)
                                    <li class="provice-box">
                                        <a href="/detail/{{$item['id']}}">
                                            <div class="provice-box-img">
                                                <img src="{{ $item['thumb'] }}" alt="">
                                            </div>
                                            <div class="provice-box-title">
                                                <h2>{{ $item['title'] }}</h2>
                                                <div class="provice-title-desc"><p>{{ $item['descs'] }}</p></div>
                                                <div class="provice-title-meta">
                                                    <span>作者：</span>
                                                    @if($item['auth_id'] == 0)

                                                        {{$user[$item['mid']]['nick_name']}}
                                                    @else
                                                        {{$admin[$item['auth_id']]['nickname']}}
                                                    @endif
                                                    <span style="margin-left: 15px">发布时间：</span>{{ $item['add_time']?date('Y-m-d',$item['add_time']):'' }}
                                                    <span style="margin-left: 15px">阅读量：</span>{{ $item['pv'] }}

                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </div>

            </div>
        </div>

        <div class="art-box">
            <div class="art"  style="margin-top: 7px">
                <span style="display: block; padding-left: 10px;border-bottom: 2px solid #e6570a"><h2>热门文章</h2></span>
                <div class="art-cl">
                    <ul>
                        @foreach($re as $item)
                        <li style="margin: 10px 0px">
                            <a href="/detail/{{$item['id']}}">
                                <span class="layui-badge-dot"></span><span style="margin-top: 8px;margin-left: 5px">{{ $item['title'] }}</span>
                            </a>
                        </li>
                        @endforeach

                    </ul>

                </div>
            </div>
        </div>
    </div>
</div>
<div class="link center">
    <h3>友情链接</h3>
    <hr>
    <ul>
        @foreach($link as $item)
        <li><a href="{{ $item['url'] }}">{{ $item['title'] }}</a></li>
        @endforeach
    </ul>
</div>
@include('home/public/footer')
</body>
</html>
<script>
    layui.use(['layer','element', 'form', 'laydate'], function(){
        var element = layui.element;
        layer = layui.layer;
        $ = layui.jquery;
        //选项卡默认打开第一个为选中状态
        $('.layui-tab-title>li:first').attr("class","layui-this");
    });
    // 轮播图
    var swiper = new Swiper('.swiper-container', {
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: {
            delay: 2500,
            disableOnInteraction: false,
        },
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
    });
</script>
